
//Copyright 1997-2009 Syrinx Development, Inc.
//This file is part of the Syrinx Web Application Framework (SWAF).
// == BEGIN LICENSE ==
//
// Licensed under the terms of any of the following licenses at your
// choice:
//
//  - GNU General Public License Version 3 or later (the "GPL")
//    http://www.gnu.org/licenses/gpl.html
//
//  - GNU Lesser General Public License Version 3 or later (the "LGPL")
//    http://www.gnu.org/licenses/lgpl.html
//
//  - Mozilla Public License Version 1.1 or later (the "MPL")
//    http://www.mozilla.org/MPL/MPL-1.1.html
//
// == END LICENSE ==
using System;

using Swaf;

namespace Swaf.BizRule
{
	public interface IRunningRule
	{
		long UniqueId {get;}

		/// <summary>
		/// Basic info about the rule that is running.
		/// </summary>
		IRuleInfo Info {get;}
		/// <summary>
		/// Provides get-only access to the running rules context.
		/// </summary>
		object this[string name]{get;set;}

		IRunningRule Parent{get;}

		/// <summary>
		/// A short-cut method that gets the decorator with the given name for 
		/// the running rule and if it has been aplied, returns its value.
		/// </summary>
		/// <param name="decoratorName"></param>
		/// <returns>The value for the decorator if it was applied
		/// to the running rule, otherwise null</returns>
		string decoratorValue(string decoratorName);

		/// <summary>
		/// A short-cut method that gets the decorator with the given name for 
		/// the running rule and if it has been aplied, returns its value.
		/// </summary>
		/// <param name="decoratorName"></param>
		/// <param name="defaultValue">The value to return if the decorator was not applied to this rule.</param>
		/// <returns>The value of the decorator if applied to the rule or the default value if not.</returns>
		string decoratorValue(string decoratorName, string defaultValue);
		object[] inputParams{get;}
	}
}